package com.main.login.interfaces.assembler;

import com.main.common.base.base.BaseAssembler;
import com.main.login.domain.user.aggregates.Account;
import com.main.login.interfaces.dto.AccountDTO;
import com.main.login.interfaces.dto.AddAccountDTO;
import jakarta.annotation.Resource;

import java.util.ArrayList;
import java.util.List;

public class AccountAssembler{

    private BaseAssembler<Account, AccountDTO> baseAssembler;


    public List<AccountDTO> toDTOs(List<Account> accountList) {
        List<AccountDTO> accountDTOList = new ArrayList<>();
        for (Account entity : accountList) {
            AccountDTO accountDTO = new AccountDTO();
            accountDTO = baseAssembler.toDTO(entity, accountDTO);
            accountDTO.setNumber(entity.getNumber());
            accountDTO.setPassword(entity.getPassword());
            accountDTOList.add(accountDTO);
        }
        return accountDTOList;
    }

}